# Maintainer: Luca Weiss <luca@lucaweiss.eu>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=lomiri-telephony-service
pkgver=0.5.3
pkgrel=3
pkgdesc="Backend dispatcher service for various mobile phone related operations"
url="https://gitlab.com/ubports/development/core/lomiri-telephony-service"
# armhf: blocked by lomiri-libusermetrics
# s390x/riscv64: blocked by ayatana-indicator-messages
arch="all !armhf !s390x !riscv64"
license="GPL-3.0-only"
depends="
	dconf
	telepathy-mission-control
	"
makedepends="
	ayatana-indicator-messages-dev
	cmake
	libnotify-dev
	libphonenumber-dev
	libqtdbustest
	lomiri-api-dev
	lomiri-history-service-dev
	lomiri-libusermetrics-dev
	lomiri-url-dispatcher-dev
	pulseaudio-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtfeedback-dev
	qt5-qtmultimedia-dev
	qt5-qtpim-dev
	telepathy-qt-dev
	samurai
	"
checkdepends="dbus-test-runner xvfb-run"
source="https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/archive/$pkgver/lomiri-telephony-service-$pkgver.tar.gz
	0001-CMakeLists.txt-pkgconf-module-name-changed-history-s.patch
	"
subpackages="$pkgname-lang"
options="!check" # Various tests hang

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
		-DSKIP_QML_TESTS=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d8cb76d05be36a7eb37f36ad9c34765694367f1206559c5e782f13ff768e20f98442b638e3138feee96a17e42cda9340351ad7ccd7bf7813aa79640af95b18e8  lomiri-telephony-service-0.5.3.tar.gz
aa61b366cb7655c4e87eae8babae24cf611520b587e69c6639ffca7813115cf6b6ff96256fc9f3bed7fef820c3b1239725fb315656946fdb0f6b8a2bba07a3bb  0001-CMakeLists.txt-pkgconf-module-name-changed-history-s.patch
"
